<?php
/**
 * This file is part of TobbiVMShop.
 *
 * TobbiVMShop is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TobbiVMShop is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TobbiVMShop.  If not, see <http://www.gnu.org/licenses/>.
 */
/**
 * Page 1
 * Server- and Mailsettings
 *
 * @version    $Id$
 * @package    TobbiVM-Shop
 * @copyright  Copyright (C) 2015
 * @author     Norbert Gebert
 * @license    GPL3
 */
?>
<p>
	<span>
		<h1>&nbsp;&nbsp;&nbsp;Server- und E-Mail-Einstellungen</h1>

	</span>
</p>
<br>
<br>
<table class="install_table" cellspacing="0" cellpadding="2px">
	<br>
	<tbody>
		<?php
		if (!isset($_SERVER['url']))
			$_SERVER['url'] = 'http://' . $_SERVER['SERVER_NAME'];
		?>
		<tr>
			<td class="left_table">Domainname (mit http://):</td>
			<td class="right_table">
				<input type="text" id="url" size="35" maxlength="60" value="<?php echo $_SERVER['url'] ?>">
			</td>
		</tr>

		<?php
		if (!isset($_SERVER['db_name']))
			$_SERVER['db_name'] = '';
		?>
		<tr>
			<td class="left_table">Name der Datenbank:</td>
			<td class="right_table">
				<input type="text" id="db_name" size="35" maxlength="60" value="">
			</td>
		</tr>

		<?php
		if (!isset($_SERVER['localhost']))
			$_SERVER['localhost'] = 'localhost';
		?>
		<tr>
			<td class="left_table">Hostname der Datenbank (meist localhost):</td>
			<td class="right_table">
				<input type="text" id="localhost" size="35" maxlength="60" value="<?php echo $_SERVER['db_name'] ?>">
			</td>
		</tr>

		<?php
		if (!isset($_SERVER['db_username']))
			$_SERVER['db_username'] = '';
		?>
		<tr>
			<td class="left_table">Benutzername der Datenbank:</td>
			<td class="right_table">
				<input type="text" id="db_username" size="35" maxlength="60" value="<?php echo $_SERVER['db_username'] ?>">
			</td>
		</tr>

		<?php
		$_SERVER['db_password'] = '';
		?>
		<tr>
			<td class="left_table">Passwort der Datenbank:</td>
			<td class="right_table">
				<input type="password" id="db_password" size="35" maxlength="60" value="">
			</td>
		</tr>

		<?php
		if (!isset($_SERVER['admin_email']))
			$_SERVER['admin_email'] = '';
		?>
		<tr>
			<td class="left_table">Administrator E-Mail-Adresse:</td>
			<td class="right_table">
				<input type="text" id="admin_email" size="35" maxlength="60" value="<?php echo $_SERVER['admin_email'] ?>">
			</td>
		</tr>

		<?php
		if (!isset($_SERVER['mail_servername']))
			$_SERVER['mail_servername'] = '';
		?>
		<tr>
			<td class="left_table">Name des Mailservers (z.B. mail.flottbuster.de):</td>
			<td class="right_table">
				<input type="text" id="mail_servername" size="35" maxlength="60" value="<?php echo $_SERVER['mail_servername'] ?>">
			</td>
		</tr>

		<?php
		if (!isset($_SERVER['mail_username']))
			$_SERVER['mail_username'] = '';
		?>
		<tr>
			<td class="left_table">Benutzername für den Mailserver:</td>
			<td class="right_table">
				<input type="text" id="mail_username" size="35" maxlength="60" value="<?php echo $_SERVER['mail_username'] ?>">
			</td>
		</tr>

		<?php
		$_SERVER['mail_password'] = '';
		?>
		<tr>
			<td class="left_table">Passwort der Datenbank:</td>
			<td class="right_table">
				<input type="password" id="mail_password" size="35" maxlength="60" value="">
			</td>
		</tr>

		<?php
		if (!isset($_SERVER['mail_port']))
			$_SERVER['mail_port'] = '587';
		?>
		<tr>
			<td class="left_table">Portnummer für den Mailserver:<br>(Je nach Konfiguration 25, 465 oder 587)</td>
			<td class="right_table">
				<input type="text" id="mail_port" size="35" maxlength="60" value="<?php echo $_SERVER['mail_port'] ?>">
			</td>
		</tr>

		<?php
		if (!isset($_SERVER['mail_sender']))
			$_SERVER['mail_sender'] = '';
		?>
		<tr>
			<td class="left_table">Absender E-Mail-Adresse:<br>(Für ausgehende Mails an Kunden etc.)</td>
			<td class="right_table">
				<input type="text" id="mail_sender" size="35" maxlength="60" value="<?php echo $_SERVER['mail_sender'] ?>">
			</td>
		</tr>

		<?php
		if (!isset($_SERVER['shop_name']))
			$_SERVER['shop_name'] = '';
		?>
		<tr>
			<td class="left_table">Absender-Name:<br>(Für ausgehende Mails an Kunden etc.)</td>
			<td class="right_table">
				<input type="text" id="shop_name" size="35" maxlength="60" value="<?php echo $_SERVER['shop_name'] ?>">
			</td>
		</tr>

		<?php
		if (!isset($_SERVER['revocation']))
			$_SERVER['revocation'] = 'TRUE';
		?>
		<tr>
			<td class="left_table">Widerufsbelehrung mit der Rechnung senden:<br>(Nur TRUE oder FALSE eingeben!)</td>
			<td class="right_table">
				<input type="text" id="revocation" size="35" maxlength="60" value="<?php echo $_SERVER['revocation'] ?>">
			</td>
		</tr>

		<?php
		if (!isset($_SERVER['terms']))
			$_SERVER['terms'] = 'TRUE';
		?>
		<tr>
			<td class="left_table">AGB mit der Rechnung senden:<br>(Nur TRUE oder FALSE eingeben!)</td>
			<td class="right_table">
				<input type="text" id="terms" size="35" maxlength="60" value="<?php echo $_SERVER['terms'] ?>">
			</td>
		</tr>

		<?php
		if (!isset($_SERVER['mail_order']))
			$_SERVER['mail_order'] = '';
		?>
		<tr>
			<td class="left_table">Absender E-Mail-Adresse für die Rechnungen:</td>
			<td class="right_table">
				<input type="text" id="mail_order" size="35" maxlength="60" value="<?php echo $_SERVER['mail_order'] ?>">
			</td>
		</tr>

		<?php
		if (!isset($_SERVER['mail_order_name']))
			$_SERVER['mail_order_name'] = '';
		?>
		<tr>
			<td class="left_table">Absendername für die Rechnungen:</td>
			<td class="right_table">
				<input type="text" id="mail_order_name" size="35" maxlength="60" value="<?php echo $_SERVER['mail_order_name'] ?>">
			</td>
		</tr>
	<tfoot> <td colspan="2"></td></tfoot>
</tbody>
</table>

<a href="http://<?php echo $_SERVER['SERVER_NAME'] ?>/install">
	<div id='back1'
		  <h1>zurück</h1>
	</div>
</a>
<a href="http://<?php echo $_SERVER['SERVER_NAME'] ?>/install/?page=2">
	<div id='next1'
		  <h1>nächste Seite</h1>
	</div>
</a>
<div class="clear"></div>